package org.come.control;

import java.math.BigDecimal;

import org.come.Frame.AthChartJframe;
import org.come.Frame.LotteryFrame;
import org.come.Frame.TrueFeedbackMainJframe;
import org.come.Jpanel.AthChartJPanel;
import org.come.Jpanel.TrueFeedbackLotteyJPanel;
import org.come.Jpanel.TrueFeedbackMainJpanel;
import org.come.action.FromServerAction;
import org.come.bean.LaborRank;
import org.come.entity.Goodstable;
import org.come.until.CutButtonImage;
import org.come.until.FormsManagement;
import org.come.until.GsonUtil;
import org.come.until.UserMessUntil;

/**
 * @author HGC<br>
 * @time 2020年4月28日 下午4:59:44<br>
 * @class 类名:LaborControl<br>
 */
public class LaborControl implements FromServerAction {

    @Override
    public void controlMessFromServer(String mes, String type) {
        LaborRank laborRank = GsonUtil.getGsonUtil().getgson().fromJson(mes, LaborRank.class);
        int type2 = laborRank.getType();
        if (type2 <= 2) {
            TrueFeedbackMainJpanel trueFeedbackMainJpanel = TrueFeedbackMainJframe.getTrueFeedbackMainJframe().getTrueFeedbackMainJpanel();
            trueFeedbackMainJpanel.getTrueFeedbackCardJPanel().showViewData(laborRank);
            if (FormsManagement.getInternalForm2(109) == null) {
                FormsManagement.showForm(109);
            } else {
                if (!FormsManagement.getframe(109).isVisible()) {
                    FormsManagement.showForm(109);
                }
            }
            try {
                if (type2 == 0) {
                    trueFeedbackMainJpanel.getBtnAddRecharge().setIcons(CutButtonImage.cuts("skin/8100226/button/B318.png"));
                    trueFeedbackMainJpanel.getBtntimeSummon().setIcons(CutButtonImage.cuts("skin/8100226/button/B321.png"));
                    trueFeedbackMainJpanel.getBtnLottey().setIcons(CutButtonImage.cuts("skin/8100226/button/B319.png"));
                    trueFeedbackMainJpanel.getTrueFeedbackCardJPanel().changeShowView(type2);
                } else if (type2 == 1) {
                    trueFeedbackMainJpanel.getBtnAddRecharge().setIcons(CutButtonImage.cuts("skin/8100226/button/B317.png"));
                    trueFeedbackMainJpanel.getBtntimeSummon().setIcons(CutButtonImage.cuts("skin/8100226/button/B322.png"));
                    trueFeedbackMainJpanel.getBtnLottey().setIcons(CutButtonImage.cuts("skin/8100226/button/B319.png"));
                    trueFeedbackMainJpanel.getTrueFeedbackCardJPanel().changeShowView(type2);
                } else if (type2 == 2) {
                    trueFeedbackMainJpanel.getBtnAddRecharge().setIcons(CutButtonImage.cuts("skin/8100226/button/B317.png"));
                    trueFeedbackMainJpanel.getBtntimeSummon().setIcons(CutButtonImage.cuts("skin/8100226/button/B321.png"));
                    trueFeedbackMainJpanel.getBtnLottey().setIcons(CutButtonImage.cuts("skin/8100226/button/B320.png"));
                    trueFeedbackMainJpanel.getTrueFeedbackCardJPanel().changeShowView(type2);
                }
            } catch (Exception e) {
            }
        } else if (type2 == 10) {

        } else if (type2 == 11) {

        } else if (type2 == 12) {
            TrueFeedbackLotteyJPanel trueFeedbackLotteyJPanel = TrueFeedbackMainJframe.getTrueFeedbackMainJframe()
                    .getTrueFeedbackMainJpanel().getTrueFeedbackCardJPanel().getTrueFeedbackLotteyJPanel();
            trueFeedbackLotteyJPanel.lotteyGoods(laborRank);
        } else if (type2 == 13){
//        	AthChartJPanel athChartJPanel = AthChartJframe.getAthChartJPanel();
//        	athChartJPanel.lotteyGoods(laborRank);
//        	AthChartJframe.getAthChartJPanel().showViewData(laborRank);*/
            LotteryFrame lotteryFrame = LotteryFrame.getLotteryFrame();
            lotteryFrame.getLotteryJpanel().showViewData(laborRank);
            if (!lotteryFrame.isVisible()) {
                FormsManagement.showForm(3004);
            }
        }
    }

}
